Skip to content

fix(moshpit): stop a stored setting outliving the default it copied - #58

Merged
ralyodio merged 1 commit into
mainfrom
fix/stored-config-shadowing
Jul 31, 2026
Merged

fix(moshpit): stop a stored setting outliving the default it copied#58
ralyodio merged 1 commit into
mainfrom
fix/stored-config-shadowing

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

A stored base beats the shipped default — that's what storing one is for. But it makes "I saved settings once" indistinguishable from "I chose this value".

An install that ever persisted moshcoding.com as its parking base keeps pointing at a route that has never existed, through every future release. #56 fixed the default and couldn't reach anyone already holding a copy of the old one.

Two halves

On read — a stored base that merely repeats a superseded default is treated as absent:

storedBase('https://moshcoding.com', 'https://pit.moshcode.sh')    'https://pit.moshcode.sh'
storedBase('https://my.pit',         'https://pit.moshcode.sh')    'https://my.pit'

Only stale defaults are on the list, so a base someone actually chose is never on it. This repairs an affected install with no action from its owner — which matters, because nobody knows to go looking in chrome.storage.local.

On write — the options page only persists what was filled in. It wrote the whole object, so an empty registry field stored "", and a stored value (even an empty one) is a decision the read path then has to keep honouring. Leaving a field out is what lets it keep following whatever the default becomes.

Tests

100/100 desktop suite, +4 covering the repair, a genuine override surviving it, empty/absent falling through, and a trailing slash counting as the same value.

Note

Needs a 3.8.8 to reach anyone — the repair is in the extension, so it ships with the browser.

🤖 Generated with Claude Code

A stored base beats the shipped default — that is what storing one is for — but
it makes "I saved settings once" indistinguishable from "I chose this value".
An install that ever persisted moshcoding.com as its parking base keeps pointing
at a route that has never existed, through every future release, and shipping
the right default does nothing about it. #56 fixed the default and could not
reach anyone already holding a copy of the old one.

Two halves.

On read, a stored base that merely repeats a superseded default is treated as
absent. Only stale defaults are on that list, so a base someone actually chose
is never on it and is never touched. This repairs an affected install with no
action from its owner, which matters because nobody knows to go looking.

On write, the options page only persists what was filled in. It wrote the whole
object, so an empty registry field stored "" — and a stored value, even an empty
one, is a decision the read path then has to keep honouring. Leaving a field out
is what lets it keep following whatever the default becomes.

100 across the desktop suite.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 06d65c5 into main Jul 31, 2026
7 checks passed
@ralyodio
ralyodio deleted the fix/stored-config-shadowing branch July 31, 2026 15:39
@ralyodio ralyodio mentioned this pull request Jul 31, 2026
ralyodio added a commit that referenced this pull request Jul 31, 2026
Ships the stored-config repair (#58). A stored base beats the shipped default,
which made "I saved settings once" indistinguishable from "I chose this value":
an install that ever persisted moshcoding.com as its parking base kept pointing
at a route that has never existed, and 3.8.7 fixing the default could not reach
anyone already holding a copy of the old one.

A stored base that merely repeats a superseded default is now treated as
absent, so an affected install repairs itself with no action from its owner.
A base someone actually chose is untouched.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant